import * as types from '../_types/user';

export function setUser (userInfo) {
    const { name, address, sessionid, userNameChain } = userInfo;
    return {
        type: types.SET_USER,
        payload: {
            name,
            address,
            sessionid,
            userNameChain,
        }
    }
}

export function login() {
    console.info('login');
}

export const test = () => {

}

export const addCount = () => {
    return {
        type: types.AddCount,
        count: 3
    }
}

export function Login(userInfo) {
    return {
        type: types.LOGIN,
        payload: userInfo
    }
}

export function Logout() {
    return {
        type: types.LOGOUT,
        payload: {
            name: null,
            sessionid: null,
            token: null,
        }
    }
}
